import os

class FindScript():
    def getScripts(self, path):
        self.scripts = []
        dirList = os.listdir(path)
        for fname in dirList:
            self.walkPath(path + os.sep + fname)
        return self.scripts   
    
    def walkPath(self, folder):
        name = os.path.basename(folder)
        if name.endswith('.txt'):
            self.scripts.append(folder)
        else:
            if os.path.isdir(folder):
                dir = os.listdir(folder)
                for fname in dir:
                    self.walkPath(folder + os.sep + fname)